#ifndef RIVIABRUSHESMGR_H
#define RIVIABRUSHESMGR_H

#include <QMap>

class BrushesBase;

class RIVIABrushesMgr
{
public:
    static RIVIABrushesMgr* getInstance();

public:
    void addBrush(const QString& strBrushType, BrushesBase* pBrush);
    BrushesBase* getCurBrush();

    void setCurBrushName(const QString &strCurBrushName);

private:
    RIVIABrushesMgr();
    ~RIVIABrushesMgr();

private:
    QString m_strCurBrushName;
    QMap<QString, BrushesBase*> m_oBrushesmap;
};

#define RIVIA_REGISTER_BRUSH(brush, BrushType)  \
class brush##Factory                                      \
{                                                                                                     \
public:                                                                                               \
    brush##Factory(){RIVIABrushesMgr::getInstance()->addBrush(#BrushType, new brush());}     \
}; \
static brush##Factory g_##brush##strategyInstance;

#endif // RIVIABRUSHESMGR_H
